﻿'
' Created by SharpDevelop.
' User: mike_sh
' Date: 10/27/2009
' Time: 8:26 PM
'
' To change this template use Tools | Options | Coding | Edit Standard Headers.
Imports PowerShellWorkBench.PWBUIHandling

Public Class PowerShellWorkBenchHost
    Inherits System.Management.Automation.Host.PSHost
    Private _instanceID As New Guid("eb30b404-18c2-455d-8271-423039280b9b" )
    private _UI as New PowerShellWorkBenchHostUI
	Public Overloads Overrides ReadOnly Property Name() As String
		Get
			return "PowerShellWorkBenchHost"
		End Get
	End Property
	
	Public Overloads Overrides ReadOnly Property Version() As Version
		Get
			return new Version(1,0,0)
		End Get
	End Property
	
	Public Overloads Overrides ReadOnly Property InstanceId() As Guid
		Get
			return _instanceID
		End Get
	End Property
	
	Public Overloads Overrides ReadOnly Property UI() As System.Management.Automation.Host.PSHostUserInterface
		Get
			return _UI
		End Get
	End Property
	
	Public Overloads Overrides ReadOnly Property CurrentCulture() As System.Globalization.CultureInfo
		Get
            Return System.Threading.Thread.CurrentThread.CurrentCulture
		End Get
	End Property
	
	Public Overloads Overrides ReadOnly Property CurrentUICulture() As System.Globalization.CultureInfo
		Get
            Return System.Threading.Thread.CurrentThread.CurrentUICulture
		End Get
	End Property
	
	Public Overloads Overrides Sub SetShouldExit(exitCode As Integer)
		Throw New NotImplementedException()
	End Sub
	
	Public Overloads Overrides Sub EnterNestedPrompt()
		Throw New NotImplementedException()
	End Sub
	
	Public Overloads Overrides Sub ExitNestedPrompt()
		Throw New NotImplementedException()
	End Sub
	
	Public Overloads Overrides Sub NotifyBeginApplication()
		Throw New NotImplementedException()
	End Sub
	
	Public Overloads Overrides Sub NotifyEndApplication()
		Throw New NotImplementedException()
	End Sub
    
 End Class


Public Class PowerShellWorkBenchHostUI
	Inherits System.Management.Automation.Host.PSHostUserInterface
	private _RawUI as New PowerShellWorkBenchHostRawUI
	Public Overloads Overrides ReadOnly Property RawUI() As System.Management.Automation.Host.PSHostRawUserInterface
		Get
			return _RawUI
		End Get
	End Property
	
	Public Overloads Overrides Function ReadLine() As String
		Throw New NotImplementedException()
	End Function
	
	Public Overloads Overrides Function ReadLineAsSecureString() As System.Security.SecureString
		Throw New NotImplementedException()
	End Function
	
	Public Overloads Overrides Sub Write(value As String)
		If value=vblf Then
            UIEvents.Add(New UIAction("Write", vbCrLf))
		else
            UIEvents.Add(New UIAction("Write", value))
		End If
	End Sub
	
	Public Overloads Overrides Sub Write(foregroundColor As ConsoleColor, backgroundColor As ConsoleColor, value As String)
        UIEvents.Add(New UIAction("Write", value))
	End Sub
	
	Public Overloads Overrides Sub WriteLine(value As String)
        UIEvents.Add(New UIAction("Write", value + vbCrLf))
	End Sub
	
	Public Overloads Overrides Sub WriteErrorLine(value As String)
        UIEvents.Add(New UIAction("Write", "ERROR:" + value + vbCrLf))
	End Sub
	
	Public Overloads Overrides Sub WriteDebugLine(message As String)
        UIEvents.Add(New UIAction("Write", "DEBUG:" + message + vbCrLf))
	End Sub
	
	Public Overloads Overrides Sub WriteProgress(sourceId As Long, record As System.Management.Automation.ProgressRecord)
		Throw New NotImplementedException()
	End Sub
	
	Public Overloads Overrides Sub WriteVerboseLine(message As String)
        UIEvents.Add(New UIAction("Write", "VERBOSE:" + message + vbCrLf))
	End Sub
	
	Public Overloads Overrides Sub WriteWarningLine(message As String)
        UIEvents.Add(New UIAction("Write", "WARNING:" + message + vbCrLf))
	End Sub
	
	Public Overloads Overrides Function Prompt(caption As String, message As String, descriptions As System.Collections.ObjectModel.Collection(Of System.Management.Automation.Host.FieldDescription)) As Dictionary(Of String, System.Management.Automation.PSObject)
		Throw New NotImplementedException()
	End Function
	
	Public Overloads Overrides Function PromptForCredential(caption As String, message As String, userName As String, targetName As String) As System.Management.Automation.PSCredential
		Throw New NotImplementedException()
	End Function
	
	Public Overloads Overrides Function PromptForCredential(caption As String, message As String, userName As String, targetName As String, allowedCredentialTypes As System.Management.Automation.PSCredentialTypes, options As System.Management.Automation.PSCredentialUIOptions) As System.Management.Automation.PSCredential
		Throw New NotImplementedException()
	End Function
	
	Public Overloads Overrides Function PromptForChoice(caption As String, message As String, choices As System.Collections.ObjectModel.Collection(Of System.Management.Automation.Host.ChoiceDescription), defaultChoice As Integer) As Integer
		Throw New NotImplementedException()
	End Function
  
End Class

Public Class PowerShellWorkBenchHostRawUI
		Inherits System.Management.Automation.Host.PSHostRawUserInterface
		
	Public Overloads Overrides Property ForegroundColor() As ConsoleColor
		Get
			return ConsoleColor.Black
		End Get
		Set
			Throw New NotImplementedException()
		End Set
	End Property
	
	Public Overloads Overrides Property BackgroundColor() As ConsoleColor
		Get
			return ConsoleColor.White
		End Get
		Set
			Throw New NotImplementedException()
		End Set
	End Property
	
	Public Overloads Overrides Property CursorPosition() As System.Management.Automation.Host.Coordinates
		Get
			Throw New NotImplementedException()
		End Get
		Set
			Throw New NotImplementedException()
		End Set
	End Property
	
	Public Overloads Overrides Property WindowPosition() As System.Management.Automation.Host.Coordinates
		Get
			Throw New NotImplementedException()
		End Get
		Set
			Throw New NotImplementedException()
		End Set
	End Property
	
	Public Overloads Overrides Property CursorSize() As Integer
		Get
			Throw New NotImplementedException()
		End Get
		Set
			Throw New NotImplementedException()
		End Set
	End Property
	
	Public Overloads Overrides Property BufferSize() As System.Management.Automation.Host.Size
		Get
			return new system.management.automation.host.size(80,80)
		End Get
		Set
			Throw New NotImplementedException()
		End Set
	End Property
	
	Public Overloads Overrides Property WindowSize() As System.Management.Automation.Host.Size
		Get
			Throw New NotImplementedException()
		End Get
		Set
			Throw New NotImplementedException()
		End Set
	End Property
	
	Public Overloads Overrides ReadOnly Property MaxWindowSize() As System.Management.Automation.Host.Size
		Get
			Throw New NotImplementedException()
		End Get
	End Property
	
	Public Overloads Overrides ReadOnly Property MaxPhysicalWindowSize() As System.Management.Automation.Host.Size
		Get
			Throw New NotImplementedException()
		End Get
	End Property
	
	Public Overloads Overrides ReadOnly Property KeyAvailable() As Boolean
		Get
			Throw New NotImplementedException()
		End Get
	End Property
	
	Public Overloads Overrides Property WindowTitle() As String
		Get
			Throw New NotImplementedException()
		End Get
		Set
			Throw New NotImplementedException()
		End Set
	End Property
	
	Public Overloads Overrides Function ReadKey(options As System.Management.Automation.Host.ReadKeyOptions) As System.Management.Automation.Host.KeyInfo
		Throw New NotImplementedException()
	End Function
	
	Public Overloads Overrides Sub FlushInputBuffer()
		Throw New NotImplementedException()
	End Sub
	
	Public Overloads Overrides Sub SetBufferContents(origin As System.Management.Automation.Host.Coordinates, contents As System.Management.Automation.Host.BufferCell(,))
		Throw New NotImplementedException()
	End Sub
	
	Public Overloads Overrides Sub SetBufferContents(rectangle As System.Management.Automation.Host.Rectangle, fill As System.Management.Automation.Host.BufferCell)
		Throw New NotImplementedException()
	End Sub
	
	Public Overloads Overrides Function GetBufferContents(rectangle As System.Management.Automation.Host.Rectangle) As System.Management.Automation.Host.BufferCell(,)
		Throw New NotImplementedException()
	End Function
	
	Public Overloads Overrides Sub ScrollBufferContents(source As System.Management.Automation.Host.Rectangle, destination As System.Management.Automation.Host.Coordinates, clip As System.Management.Automation.Host.Rectangle, fill As System.Management.Automation.Host.BufferCell)
		Throw New NotImplementedException()
	End Sub

End Class